#include "stdafx.h"
#include "CPreSMSEditStatu.h"
#include "GlobalStatic.h"
#include "CGraphicMgr.h"
CPreSMSEditStatu::CPreSMSEditStatu(WCHAR * name):IStatu(name)
{

}
CPreSMSEditStatu::~CPreSMSEditStatu(void)
{
}




 bool CPreSMSEditStatu::EnterStatu()
 {

   	m_pContent=(CEdit*)GRAPHICMGR.GetElement(L"presmscontent");
	m_pContent->SetFocus();
	 // ShowWindow(m_pContent->m_hWndEdit,SW_SHOWNA);
	 return true;
 }

 bool CPreSMSEditStatu::ExitStatu()
 {
	
	 ShowWindow(m_pContent->m_hWndEdit,SW_HIDE);
	 CGenericFun::IME_Change(EIME_OFF);
	 return true;
 }

 bool CPreSMSEditStatu::EvaluateClickEvent(const WCHAR* elementName)
 {
	 if (wcscmp(elementName,L"presms_keyboard") == 0)
	 {
		 // return  DialOut();
		 CGenericFun::IME_Change(EIME_ENGLISH);
		 return true;

	 }
	 else if (wcscmp(elementName,L"presms_save") == 0)
	 {
		CRecvMessageData *pPreMessages=new CRecvMessageData;
	    pPreMessages->Load(CGenericFun::GetAbsPath(FILE_PREMESSGELIST));
	
	    pPreMessages->Add(NULL,m_pContent->GetWindowText(),NULL,NULL);
		pPreMessages->Save(CGenericFun::GetAbsPath(FILE_PREMESSGELIST));

		 
         GRAPHICMGR.PostChange(L"presmslist");
		 
		 
		 return true;
	 }
	
	 return false;
 }
